# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Maxwell Pray a.k.a. Synthead <synthead@gmail.com>
# Contributor: Justin Davis <jrcd83@gmail.com>

pkgname=perl-sub-name
_cpanname=Sub-Name
pkgver=0.27
pkgrel=1
pkgdesc="(re)name a sub"
arch=('loong64' 'x86_64')
license=('PerlArtistic' 'GPL')
depends=('perl')
options=('!emptydirs')
url="https://search.cpan.org/dist/$_cpanname"
source=("https://search.cpan.org/CPAN/authors/id/E/ET/ETHER/$_cpanname-$pkgver.tar.gz")
sha256sums=('ecf36fba1c47ca93e1daa394968ed39c4186867459d9cd173c421e2b972043e8')

build() {
  cd "$srcdir/$_cpanname-$pkgver"
  perl Makefile.PL
  make
}

check() {
  cd "$srcdir/$_cpanname-$pkgver"
  make test
}

package() {
  cd "$srcdir/$_cpanname-$pkgver"
  make install INSTALLDIRS=vendor DESTDIR="$pkgdir"
}
